//
//  yxpPulldownList.h
//  TestProject
//
//  Created by 杨小平 on 14-8-26.
//  Copyright (c) 2014年 yangxiaoping. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol yxpPulldownListDelegate,yxpPulldownListDataSource;

#define SECTION_BTN_TAG_BEGIN   1000
#define SECTION_IV_TAG_BEGIN    3000


@interface yxpPulldownList : UIImageView<UITableViewDelegate,UITableViewDataSource>{
    NSInteger currentExtendSection;     //当前展开的section ，默认－1时，表示都没有展开
    
    NSInteger currentSelectIndex;     //每列选中的index
    NSInteger currentSelectTitleIndex;  //每列选中的index下默认选中的行数
    
    float currentSectionHeight;  //当前列的高度
    
    NSString *sectionBtnTitle;
}

@property (nonatomic, assign) id<yxpPulldownListDelegate> delegate;  //布局委托
@property (nonatomic, assign) id<yxpPulldownListDataSource> dataSource; //数据委托

@property (nonatomic, strong) UIView *mSuperView; //吃控件加载的视图上
@property (nonatomic, strong) UIView *mTableBaseView; //展开后的大背景
@property (nonatomic, strong) UITableView *mTableView; //第一级列表
@property (nonatomic, strong) UITableView *mbTableView; //第二级列表

- (id)initWithFrame:(CGRect)frame dataSource:(id)datasource delegate:(id) delegate superView:(UIView *)superView;

- (void)setTitle:(NSString *)title inSection:(NSInteger) section;

//判断是否已经展开
- (BOOL)isShow;

//
- (void)hideExtendedChooseView;




@end


@protocol yxpPulldownListDelegate <NSObject>

@optional

-(void) chooseAtSection:(NSInteger)section index:(NSInteger)index titleIndex:(NSInteger)titleindex;

@end



@protocol yxpPulldownListDataSource <NSObject>

-(NSInteger)numberOfSections;

-(NSInteger)numberOfRowsInSection:(NSInteger)section;

-(BOOL)titleIndexSectionIsBeingWithSection:(NSInteger)section;

-(NSInteger)numberOfRowsInSection:(NSInteger)section index:(NSInteger)index;

-(NSString *)titleInSection:(NSInteger)section index:(NSInteger) index;

-(NSString *)titleInSection:(NSInteger)section index:(NSInteger)index titleIndex:(NSInteger)titleindex;

-(NSInteger)defaultShowSection:(NSInteger)section;

-(NSInteger)defaultShowSection:(NSInteger)section index:(NSInteger)index;

@end
